import http from './httpInstance'

function getUserInfo () {
  return http({
    method: 'get',
    url: 'https://my-json-server.typicode.com/zimplexing/demo/userInfo',
  })
}

// 将区域与项目进行绑定
export const saveOrUpdate = data => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/region/project/saveOrUpdate',
    data
  })
}

// 获取第三方项目列表
export const getProjectList = params => {
  return http({
    method: 'get',
    url: '/gscaps/api/v1/region/project/getProjectList',
    params
  })
}

// 根据区域编号查询是否绑定项目信息
export const queryDetail = params => {
  return http({
    method: 'get',
    url: '/gscaps/api/v1/region/project/queryDetail',
    params
  })
}

// 查询区域列表
export const queryRegionList = params => {
  return http({
    method: 'get',
    url: '/gscaps/api/v1/region/project/queryRegionList',
    params
  })
}

// 清空区域绑定的项目信息
export const cleanProject = data => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/region/project/clean',
    data
  })
}

// 查询
export const querySettlementReport = data => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/report/querySettlementReport',
    data
  })
}

// 导出
export const reportExport = data => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/report/export',
    data,
    responseType: 'blob'
  })
}

// 获取组织树
export const getRegionList = params => {
  return http({
    method: 'get',
    url: '/gscaps/api/v1/region/queryRegionList',
    params
    // responseType: 'blob'
  })
}

// 获取组织树
export const findByPage = data => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/device/findByPage',
    data
    // responseType: 'blob'
  })
}

// 导出
export const exportStatisticsData = () => {
  return http({
    method: 'get',
    url: '/gscaps/api/v1/statistics/exportStatisticsData',
    responseType: 'blob'
  })
}

// 访客数总览，包含当天、当月、本年
export const overview = () => {
  return http({
    method: 'get',
    url: '/gscaps/api/v1/statistics/overview'
  })
}

// 条件查询-设备进出访客数统计
export const pageList = data => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/statistics/pageList',
    data
  })
}



// 统计学校信息
export const getSchoolInfo = () => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/statistics/schoolInfo'
  })
}

// 按学校统计监控点在离线
export const cameraOnOfflineBySchool = (params) => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/statistics/cameraOnOfflineBySchool',
    data: params
  })
}

// 学校监控点在线率top10
export const cameraOnlineRateRank = params => {
  return http({
    method: 'post',
    url: '/gscaps/api/v1/statistics/cameraOnlineRateRank',
    data: params
  })
}
export { getUserInfo }
